package com.bingbing.back.service.Impl;

import com.bingbing.back.dto.AdminInfoDto;
import com.bingbing.back.dto.ConsultInfoDto;
import com.bingbing.back.mapper.ConsultInfoMapper;
import com.bingbing.back.mapper.StuInfoMapper;
import com.bingbing.back.po.AdminInfo;
import com.bingbing.back.po.ConsultInfo;
import com.bingbing.back.service.ConsultInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ConsultInfoServiceImpl implements ConsultInfoService {
    @Resource
    private ConsultInfoMapper consultInfoMapper;
    @Resource
    private StuInfoMapper stuInfoMapper;
    @Override
    public int doDelete(Integer consultId){
        int row=0;
        row=consultInfoMapper.delete(consultId);
        return row;
    }
    @Override
    public PageInfo<ConsultInfo> findByParam(int pageNum,int pageSize,ConsultInfoDto dto){
        PageInfo<ConsultInfo> page=null;
        PageHelper.startPage(pageNum,pageSize);
        List<ConsultInfo> ads=consultInfoMapper.findByParam(dto);
        page=new PageInfo<>(ads);
        return page;
    }
    @Override
    public int dofindByConsultId(Integer consultId){
        int row=0;
        row=stuInfoMapper.findByConsultId(consultId);
        return row;
    }
}
